﻿@model PeaceBlogData.Tables.Authors

@{
    ViewBag.Title = "AddAuthor";
    Layout = "~/Views/_PeaceAdminLayout.cshtml";
}

@Html.Partial("AdminPartial/AdminTitle", new PeaceBlog.Models.Types.AdminTitle()
{
    Title = ViewBag.Title,
    FirstLink = Html.ActionLink("Yazarlar", "AuthorList"),
    LastLink = Html.ActionLink("Yazar Ekle", "AddAuthor")
});

<div class="row-fluid">
    <div class="span12">
        <!-- BEGIN SAMPLE FORM widget-->
        <div class="widget">
            <div class="widget-title">
                <h4><i class="icon-reorder"></i>@ViewBag.Title</h4>
                <span class="tools">
                    <a href="javascript:;" class="icon-chevron-down"></a>
                    <a href="javascript:;" class="icon-remove"></a>
                </span>
            </div>
            <div class="widget-body form">
                <!-- BEGIN FORM-->
                @using (Html.BeginForm("AddAuthor", "BlogAdmin", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal" }))
                {
                    @Html.AntiForgeryToken()

                    @Html.ValidationSummaryEx()

                    <div class="control-group">
                        @Html.LabelFor(p => p.NameSurname, new { @class = "control-label" })
                        <div class="controls">
                            @Html.EditorFor(p => p.NameSurname, new { @class = "span6" })
                            @Html.ValidationMessageFor(p => p.NameSurname)
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(p => p.Email, new { @class = "control-label" })
                        <div class="controls">
                            @Html.EditorFor(p => p.Email, new { @class = "span6" })
                            @Html.ValidationMessageFor(p => p.Email)
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(p => p.Password, new { @class = "control-label" })
                        <div class="controls">
                            @Html.EditorFor(p => p.Password, new { @class = "span6" })
                            @Html.ValidationMessageFor(p => p.Password)
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(p => p.Phone, new { @class = "control-label" })
                        <div class="controls">
                            @Html.EditorFor(p => p.Phone, new { @class = "span6" })
                            @Html.ValidationMessageFor(p => p.Phone)
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(p => p.Description, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextAreaFor(p => p.Description, new { @class = "span6" })
                            @Html.ValidationMessageFor(p => p.Description)
                        </div>
                    </div>

                    <div class="control-group">
                        @Html.LabelFor(p => p.ImageID, new { @class = "control-label" })
                        <div class="controls">
                            <div class="fileupload fileupload-new" data-provides="fileupload">
                                <div class="fileupload-new thumbnail" style="width: 200px; height: 150px;">
                                    <img src="@Html.ImageUrl(0, true)" alt="" />
                                    @Html.CheckBox("ResimYok", false)
                                    @Html.Label("lblResim", "Resim Yok")
                                </div>
                                <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>
                                <div>
                                    <span class="btn btn-file">
                                        <span class="fileupload-new">Resim Seç</span>
                                        <span class="fileupload-exists">Değiştir</span>
                                        
                                        <input type="file" class="default" id="file" name="file" />
                                    </span>
                                    <a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Kaldır</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(p => p.About, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextAreaFor(p => p.About, new { @class = "span12 ckeditor", rows = "4" })
                            @Html.ValidationMessageFor(p => p.About)
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(p => p.WebSite, new { @class = "control-label" })
                        <div class="controls">
                            @Html.EditorFor(p => p.WebSite, new { @class = "span6" })
                            @Html.ValidationMessageFor(p => p.WebSite)
                        </div>
                    </div>
                    <div class="form-actions">
                        <button type="submit" class="btn btn-success">Ekle</button>
                        <button type="button" class="btn">İptal</button>
                    </div>
                }
            </div>
        </div>
    </div>
</div>

@section Styles{
    <link href="~/Templates/Admin/assets/bootstrap/css/bootstrap-fileupload.css" rel="stylesheet" />
}

@section Scripts{

    <script type="text/javascript" src="~/Templates/Admin/assets/bootstrap/js/bootstrap-fileupload.js"></script>
    <script type="text/javascript" src="~/Templates/Admin/assets/ckeditor/ckeditor.js"></script>
}